package com.woniuxy.businessassembly.dao;

import com.woniuxy.businessassembly.model.HotelFacilities;
import com.woniuxy.businessassembly.model.HotelFacilitiesFunctions;
import com.woniuxy.businessassembly.model.HotelServer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Kevin Kwok
 * @since 2021-05-24
 */
@Mapper
public interface HotelServerMapper extends BaseMapper<HotelServer> {

    /*查询酒店id下这个酒店拥有哪些服务,得到的是服务ID集合*/
    @Select("selete hotel_server_id from hotel_server where hotel_id = #{hotelId}")
    List<Integer> queryAllById(Integer hotelId);

    /*查询这个酒店拥有的某个服务有哪些设施*/
    @Select("select * from hotel_facilities where hotel_server_id = #{serverId}")
    List<HotelFacilities> queryAllFacilities(Integer serverId);

    /*根据facilitiesId查询某个设施下面的具体功能*/
    @Select("select * from hotel_facilities_functions where facilities_id = #{facilitiesId}")
    HotelFacilitiesFunctions queryAllFunction(Integer facilitiesId);

    /*查询hotel_server表，得到server集合*/
    @Select("selete * from hotel_server where hotel_id = #{hotelId}")
    List<HotelServer> queryAllServer(Integer hotelId);

    /*查询hotel_server表，根据serverID查询*/
    @Select("selete * from hotel_server where hotel_server_id = #{hotelServerId}")
    HotelServer queryServerByServerId(Integer hotelServerId);
}
